package com.alibaba.cloud.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import org.apache.ibatis.type.LocalDateTimeTypeHandler;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author cruise
 * @since 2022-06-13
 */
@TableName("t_user_info")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名称
     */
    private String userName;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 部门名称
     */
    private String deptName;

    /**
     * 用户职位
     */
    private String position;

    /**
     * 用户头像地址
     */
    private String headImgUrl;

    /**
     * 用户手机号 唯一
     */
    private String mobile;

    /**
     * 用户微信账户
     */
    private String weChat;

    /**
     * qq 账户
     */
    private String qqChat;

    /**
     * 用户状态  0 删除 1 正常
     */
    private Integer status;

    /**
     * 小程序权限 0 未开启 1 开启    用户身份标识（是否开启了小程序）
     */
    private Integer miniAuth;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 用户所属的分支
     */
    private String address;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 生日
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = LocalDateTimeTypeHandler.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    private LocalDate birthday;
    /**
     * 性别
     */
    private Integer gender;
    /**
     * 身份证
     */
    private String idCard;

    /**
     * 用户介绍
     */
    private String introduction;

    /**
     * 操作人域账号
     */
    private String creator;

    /**
     * 操作人姓名
     */
    private String updater;

    /**
     * 添加时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = LocalDateTimeTypeHandler.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = LocalDateTimeTypeHandler.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;
}
